GIT

Learning Git

So I went to a hackathon and had to work with branches. I realized I had forgotten the basics, so I’m writing them here for future reference.

Check current branch

git branch

Create and switch to a new branch

git checkout -b branchname

This creates a new branch locally and switches you to it. At this point, GitHub doesn’t know about this branch.

Add and commit changes

git add .
git commit -m "message"

Push branch to GitHub

git push -u origin branchname

The -u flag links your branch so next time you can just use git push.

Push future commits

git push

Fetch latest branches from remote

git fetch

See available Branches

git branch -a
Was ist Merge Requests? Wenn jemand eine Änderung gemacht habe und wenn wir es in Hauptbranche übernehmen wollen dann müssen wir es mergen, und der Inhaber sollte es akzeptieren das Merge Request. Das passiert über das Platform Github.

Comments

Popular Posts