-
-
Save JaydipZala/c475dd46bf9d47b01a10ec6c4080c99b to your computer and use it in GitHub Desktop.
Git basic commands
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
git init | |
git clone [repository url] | |
git remote add origin [repository url] | |
touch .gitignore | |
git add [path to file] | |
git add --all | |
git rm --cached [file path/pattern like .idea/*] -r | |
git commit -m [commit message] // commit stage files to local repository | |
git push origin master OR git push -u origin master // pushes local repository | |
git branch [branch name] // creates a branch | |
git branch // shows local repository branch list | |
git branch --remote // shows remote branch list | |
git checkout [branch name] // to swith between branch | |
git merge [branch name] // merge branch name to current workign branch | |
git branch -D [branch name] // deletes local branch | |
git push origin :[branch name] OR git push origin --delete [branch name]// deletes remote branch | |
git fetch origin [from branch name remote]:[to branch name local repository] // clone remote branch to local repo branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment