-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_commands.txt
More file actions
44 lines (31 loc) · 1.43 KB
/
git_commands.txt
File metadata and controls
44 lines (31 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Git cheat sheet: help.github.com/git-cheat-sheets/
What follows is just a list of things I found helpful:
Forking the repo (you already did this if you are capable of reading this file):
git clone git@github.com:jps327/KingFishAI.git
Then go into the folder that just got created:
cd KingFishAI
git remote add upstream git://github.com/jps327/KingFishAI.git
git fetch upstream
This will make your forked repo point back to the original KingFishAI repo.
IMPORTANT:
It is recommended (but certainly not essential) that you do not work straight from the master branch.
Create new branches - branches are really helpful ways to test new things out independently of each other.
To create a branch and switch into it:
git checkout -b mybranch
To switch to a branch:
git checkout
Deleting a branch:
git branch -d mybranch
COMMITTING AND PUSHING CHANGES:
Committing changes (this does not yet push your changes to the original repo):
git commit -a
Once you've finished working on your branch and are ready to merge it back into your master branch:
git checkout master
git merge mybranch
Pushing changes into to the repo (so that the rest of us can pull these changes and see what you've done):
git push origin master
Pulling in changes from the original repo: (always do this if you suspect the original repo may have changed)
git fetch upstream
git merge upstream/master
Making sure that changes on master appear in your current branch:
git rebase master