Command | Uses |
---|---|
git init |
to initialize a git repository |
git status |
to check the status of the repository |
git add <filename> |
to track files/folders (stage) |
git add . |
to track all files/folders (stage) |
git commit -m "message" |
to commit changes with the message |
git commit -a -m "message" |
to track and commit changes with the message (stage and commit) |
git log |
to view commit history |
git remote add <remote-name> <branch-name> |
to add remote server |
git remote -v |
to view remote server list |
git push -u <remote-name> <branch-name> |
to push to remote server |
git pull <remote-name> <branch-name> |
to pull from remote server |
- | - |
git branch <branch-name> |
to create a new branch |
git branch |
to list branches |
git checkout <branch-name> |
to list branches |