Skip to content

Instantly share code, notes, and snippets.

@shivanandmn
Last active June 28, 2021 04:08
Show Gist options
  • Save shivanandmn/84f7c26f6c3b75863a76d9e3daadff28 to your computer and use it in GitHub Desktop.
Save shivanandmn/84f7c26f6c3b75863a76d9e3daadff28 to your computer and use it in GitHub Desktop.
Basic git commands I am learning while at work.
git branch -a #get all branch
git checkout master #get to the master branch
git checkout -b new_branch #(create and get) new branch
git push -u origin new_branch #push changes to new_branch to repo. for first push -u will set upstream/tracker.
git pull origin guru #pull the repo from guru branch
git add . # add present changes
git commit -m "fdhkfjd" # commit all the added changes.
git push origin guru #then push it
git branch -vv # upstream settings
#for mac quotes are required
git add --all -- ':!path/to/file1' ':!path/to/file2' ':!path/to/folder1/*'
# if your first time user then you need to use this, this helps to connect your pc to github.
#https://kbroman.org/github_tutorial/pages/first_time.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment