You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Git commands

# Configure
git config --global user.name "My Name"
git config --global user.email my.name@example.com

# Retrieve code
git clone ssh://<user>@<server>:<project>
git checkout <file>

# Staging code:
git add <file>
git rm <file>
git reset HEAD -- <file>

# Commit staged files:
git commit
git commit -m "commit message"

# Inspecting changes:
git log
git diff
git show

# Synchronizing code:
git fetch
git merge # merges changes of two branches
git pull # merges changes from the remote to the local working space
git push # uploads changes from the local working space to the remote

# Branching
git branch -a
git checkout -b <branch>
git checkout <branch>


Presentation

As pptx: Introduction to Code Repository Git.pptx



  • No labels