.git
folderdiff
and patch
utilitiescd <REPO> git init ls -alh
git clone https://github.com/<USER>/<REPO> cd <REPO> ls -alh
git status git diff git diff --cached git log
Note: this may use the pager (less
/more
)
Get changes from a specific remote, optionally integrating them into the current branch
git fetch <REMOTE> git pull <REMOTE>
You can always fetch the changes but pulling requires the local and remote branches to be somewhat aligned.
fast-forward
operation.git push <REMOTE> <BRANCH>
Github/Gitlab | Regular Git |
---|---|
Changes are pushed to your account | changes are pushed to a throw-away branch |
Merged by using a PR/MR on the website | Merged manually if no conflicts arise |
Inspection by collaborators during MR | No inspection until deployed |
Do NOT push directly tomaster
!
From safe to loosing all local changes since last commit:
git stash git reset git reset --hard git checkout <CLEAN> && git checkout -B <BRANCH>
Read the manual before loosing more of your changes than you wanted to reset!
Highly dependent on project/organization! But:
master
merge request
s for every branch, that’s done or ready for reviewcommit message
sCombined like this is a good way to start working:
git checkout master git pull origin git checkout -b addGitTalk
git diff git status git add [PATH] git diff --cached
git commit git push
</blockquote></HTML>
git checkout -b <NAME> ... git add [PATH] git diff; git diff --cached git commit