Getting Started - Git

From Xem2
Jump to navigationJump to search

Common Git Commands USed

Used before, complicated

Lets say Casey added a branch to hallc_replay_XEM that you'd like to use. We want to put that on our origin, but the fetch upstream button on github does not add the new branch to your origin. To do this we must: First ensure you are tracking the remote upstream: git remote -v Lists all names of remote repositories and the path to them git remote add upstream git@github.com/mrcmor100/hallc_replay_XEM.git Now that we told our local where upstream is, we can track the new branch in our local: git checkout upstream_branch_name You could alternatively name this whatever you'd like (don't) git pull upstream upstream_branch_name Pulls from upstream to local git push origin local_branch_name local_branch_name should match upstream_branch_name! Great, now you have the upstream branch on your origin. Thing to check If Casey updates upstream_branch_name, will there be a fetch upstream option for that branch? Lets say we want to stop tracking old branches that no longer exist: git remote prune origin That'll do it for ya'!