Skip to content

Instantly share code, notes, and snippets.

@milinmestry
Created July 12, 2018 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milinmestry/3a7d23750088f0c60f389ea7981fd616 to your computer and use it in GitHub Desktop.
Save milinmestry/3a7d23750088f0c60f389ea7981fd616 to your computer and use it in GitHub Desktop.
Helpful GIT commands
GIT NOTES-
Create a branch in Git from another branch
https://stackoverflow.com/questions/4470523/create-a-branch-in-git-from-another-branch
For first time to fetch PHASE-3 branch on local machine:
git fetch && git checkout PHASE-3
To fetch all latest changes from other developer(s) on your local machine:
git pull origin PHASE-3
Create a new branch (IBR-277) under PHASE-3 branch:
git checkout -b IBR-277 PHASE-3
Check which files to be added in the commit:
git status -s
Add file(s) in the local branch created above:
git add file1 file2 fileN
Add commit message:
git commit -m "IBR-277 message for this commit."
Push the changes to remote GIT repository under PHASE-3 branch:
git push origin IBR-277:PHASE-3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment