- Getting Started
- Create a new repository by instantiating it through
bash git init
- Copy an existing project by cloning the repository through
bash git clone <url>
- To instantiate a central repository a
--bareflag is required.
- Bare repositories don't allow file editing or committing changes.
- Create a bare repo with
bash git init --bare project-name.git
- Create a project in your user namespace
- Choose to import from 'Any Repo by URL' and use https://gitlab.com/gitlab-org/training-examples.git
- Create a '
Workspace' directory in your home directory.
- Clone the '
mkdir ~/workspace cd ~/workspace git clone firstname.lastname@example.org:<username>/training-examples.git cd training-examples
New files that Git has not been told to track previously.
Files that have been modified but are not committed.
Modified files that have been marked to go in the next commit.
- Edit '
edit_this_file.rb' in '
- See it listed as a changed file (working area)
- View the differences
- Stage the file
- Push the commit to the remote
- View the git log
# Edit `edit_this_file.rb` git status git diff git add <file> git commit -m 'My change' git push origin master git log
- git fetch vs pull
- Pull is git fetch + git merge