diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-08 17:49:00 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-08 17:49:00 +0200 |
| commit | abd57e8d5b19a3d6e42a3f549d6b4079686f893f (patch) | |
| tree | 8e7d95b96732bb655b60d5683e47f81d701cfdf7 | |
| parent | 037ab06210f4f86b22abee28bce4590a1501ecc5 (diff) | |
| download | DevHive-abd57e8d5b19a3d6e42a3f549d6b4079686f893f.tar DevHive-abd57e8d5b19a3d6e42a3f549d6b4079686f893f.tar.gz DevHive-abd57e8d5b19a3d6e42a3f549d6b4079686f893f.zip | |
more git instuctions added
| -rw-r--r-- | git.md | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +# Git commands with instructions + +## git clone *url* + +Clones a GitHub repository in the current directory, in a folder, the name of which is the repo's name + +## git diff + +See the changes made + +## git branch *option* *branch* + +git branch - View a list of the branches + +## git checkout *option* *branch* + +git checkout *branch_name* - Switch to exiting branch +git checkout -b *branch_name* - Create a new branch + +## git fetch + +git fetch - Downloads commits, files and references from remote repo to local repo + Fetching is what you do when you want to see what everybody else has been working on. + Doesn't force a merge + +## git pull *option* + +git pull - Fetches changes and immediately merges them to local repo + Combo of git fetch & git merge +git pull --rebase - "I want to put my changes on top of what everybody else has done in this branch." +git pull --rebase origin - This simply moves your local changes onto the top of what everybody else has already contributed. + +## git add *files* + +git add . - Add all files to track the changes made to them +git add *filename* - Add file with name *filename* to track the changes made to it + +## git commit *options* + +git commit - Opens a editor to write a message, documenting the changes made +git commit -m *Message* - Write the message inline, documenting the changes made |
