Skip to content

Instantly share code, notes, and snippets.

@kumarandena
Created May 1, 2019 16:16
Show Gist options
  • Save kumarandena/b3425fcf0c6ade420f02001ecb2138d2 to your computer and use it in GitHub Desktop.
Save kumarandena/b3425fcf0c6ade420f02001ecb2138d2 to your computer and use it in GitHub Desktop.
Useful GIT Commands
Basic Commands:
git fetch --all (Fetch all of the branches from the repository)
git checkout branchname (to change the local branch)
git pull (to take all latest from origin)
git branch (to check current branch and list all branches)
git checkout -b feature_name (to create new branch with your feature)
git branch -d branchname (to delete branch)
Commit Commands:
git add .
git add rootname/foldername/subfoldername/*
git add rootname/foldername/foldername/filename.css -f
git commit -m "commit message"
git push origin branchname
Merge Commands:
1. git branch
2. git pull(If any error occurred)
3. git checkout -b temp 1035929(branchname/feature commit id)
4. git log
5. git checkout feature/featurename(your branch)
6. git merge temp
If any changes,
1. git status
2. git add .
3. git commit -m 'merge conflict fix'
4. git push origin feature/featurename
5. Try again the step 6
7. git branch -d temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment