work

Using Git Profiling C++ Asciinema Jekyll

general

Vacation Checklist


Branches

Create new branch and switch to it:

git checkout -b branchname

Switch to an existing branch:

git checkout branchname

Merge changes from branch1 into branch2 (one of them can be main). Use rebase for a clean history. Alternatively, you can use merge to keep the history of both branches.

git checkout branch2
git rebase branch1 

If conflicts arises:

  1. Open each conflicted file (<<<<<<<, =======, >>>>>>> markers).
  2. Manually resolve the conflicts by editing the file.
  3. After resolving conflicts, mark the files as resolved:
    git add conflicted_file
    

If necessary, keep one version of the other of one file:

git checkout --ours conflicted_file  # Keep our version
git checkout --theirs conflicted_file  # Keep their version

Finalizing rebase (notice commit w/o message):

git commit
git rebase --continue
git push origin branch2

The status can be:

Push a branch to remote:

git push -u origin branchname

Delete a remote branch:

git push origin --delete branchname

List all remote branches: