title | marp | paginate |
---|---|---|
Git cheat sheet |
true |
true |
Initialize Git in the Unity project folder, pull the .gitignore
file, make your first commit and push:
git init
git remote add origin [remote-url]
git pull origin main
git add .
git commit -m "first commit"
git push --set-upstream origin main
git status
git add filename
git commit -m "make change"
git pull
(If working in a team, always pull before pushing!)
git push
git checkout -b newBranch
- This is a shorthand for
git branch newBranch && git checkout newBranch
git add newFile.txt
git commit -m "add newFile.txt"
git push --set-upstream origin newBranch
- (The line above creates a new remote branch. After doing it once, you can just use regular git push)
git checkout master
git merge newBranch
- This is where the conflicts happen. Fix them in VS code
git add conflictedFile.txt
git commit
git push
-
On feature branch:
git fetch origin master:master
git merge master