Created
November 1, 2014 19:04
-
-
Save filipkral/f9b8532c3f4e7f87b184 to your computer and use it in GitHub Desktop.
Basics of git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://confluence.atlassian.com/display/STASH/Basic+Git+commands | |
# simplest example | |
git clone https://github.com/some/repo repo | |
cd repo | |
# make changes to files | |
git commit -a -m "Commit message" | |
# you can check status by `git status` | |
git push origin master | |
# to work on a branch | |
git clone https://github.com/some/repo repo | |
cd repo | |
# list all branches with `git branch` | |
# crate a new branch (leave out -b to switch branches): | |
git checkout -b mybranch | |
# make changes to files, add them to git control, and commit: | |
git add folder/file.py | |
git commit -a -m "Commit message" | |
# push branch to remote repo, or all branches git push --all origin | |
git push origin mybranch | |
# once the admin merges the branch you can delete it if they didn't | |
git push origin :mybranch | |
# you can then delete your local branch after you switch to another one | |
git branch -d mybranch | |
# and pull changes from remote repo | |
git pull | |
# hopefully there won't be any merge conflicts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment