-
Before starting anywork To make sure everything is in sync
git pull
-
To push your work
git push
git push origin <branch>
-
To commit your work
git add . git commit -m "message" git push --all
-
To push the work to master
git push
git push origin <branch>
git push origin mayank:master
-
To change the branch
git checkout <branch_name>
-
To set the username of github
git config --global user.email "email@email.com" git config --global user.name "unname"
-
To set the proxy
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
To unset the proxy
git config --global --unset http.proxy
-
To handle the conflicts
git checkout --thiers .
git checkout --ours .
-
To add user credentials
git config --global credential.https://github.com.username <your_username>
-
To make an existing directory a git repo
git init
-
To host an existing directory on GitHub
git init git add -A git commit -m'' git remote add original <url> git pull <url> master --allow-unrelated-histories git push --set-upstream origin master
-
To check status of working tree
git status
-
To Inspect & Compare (Examining logs, diffs and object information)
git log (show the commit history for the currently active branch) git log branchB..branchA (show the commits on branchA that are not on branchB) git log --follow [file] (show the commits that changed file, even across renames) git diff branchB...branchA (show the diff of what is in branchA that is not in branchB) git show [SHA] (show any object in Git in human-readable format)
-
Notifications
You must be signed in to change notification settings - Fork 3
may55/Git-Tutorials
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Git commands
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published