Skip to content

Instantly share code, notes, and snippets.

@Abhinay-g
Created December 8, 2018 08:29
Show Gist options
  • Save Abhinay-g/dc75014e5d72a209d1f0ebf6e93c97e6 to your computer and use it in GitHub Desktop.
Save Abhinay-g/dc75014e5d72a209d1f0ebf6e93c97e6 to your computer and use it in GitHub Desktop.
touch .gitignore
git init
git add .
git commit -m "First commit"
git remote add origin remote repository URL
git push origin master
===========================================
create branch :
git branch branch-name
get all branches :
git branch
move to new branch :
git checkout branch-name
commit changes to git branch:
git commit -am "commit statement"
*note it add and commit in one shot
create a branch and checkout branch:
git checkout -b branch-name
*note this will create a branch if branch does not exists
merge git branch :
git checkout branch-name-where-you-want-to-merge
git merge branch-name-which-you-want-to-merge
push changes to github:
git push origin branch-name
*origin will be current branch
*branch name will be branch on github
*if brnach name is not on github then it will be created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment