Git Tutorial¶
How to Push/Pull/Merge on Git¶
Cloning from repository on Git¶
To clone from a repository onto your own computer:
git clone [Insert Link Here]
This will start you off in a branch “main”
Creating Branch on Git¶
To create branch named “atest” using branch “main” as a base:
git checkout main
git branch atest
git checkout atest
or:
git checkout main
git checkout -b atest
Pushing on Git¶
To push from branch “atest” to branch “main”:
(If your main branch is not up to date with the server then you must pull first)
git checkout atest
git add .
git commit -m "[insert message here]"
git checkout main
git merge atest
To then push to the server:
git push
Pulling on Git¶
To update your “main” branch with the server:
git checkout main
git pull
To then merge that with your current work “atest”:
git checkout atest
git merge main