Table of Contents
Updating feature branch with the latest development branch
tags | bring feature branch up to date with development branch
- User 1 raised a merge request to merge feature1 to development branch
- Before the merge request is accepted, development branch is updated by User 2
- Say you forked from development branch a while ago to work on a feature and created a branch called “feature1”.
- After a while, development branch might have progressed and may have new changes added to it.
- Bring the feature1 branch up to date with the latest development branch.
Get the latest versions of development and feature branches in the local repository.
git checkout development git pull git checkout feature1 git pull
Merge development branch into the feature branch and resolve any conflicts that may arise.
git merge development
Push the changes to the remote.
Note:- The “git merge development” command works even if you have local changes not committed to feature1.
Initializing git for version control
git config --global user.name "Kamaraju S. Kusumanchi" git config --global user.email "email@example.com" git config --global push.default matching git config --global alias.co checkout git init
- https://learngitbranching.js.org/ - Very good resource to learn git branching.
stackoverflow answers I came across
- ignore all directories with a specific name - https://stackoverflow.com/questions/1470572/ignoring-any-bin-directory-on-a-git-project
show which branch is linked to which remote branch
rename a branch that has already been pushed
tags | change the remote branch name
show contents of a deleted file
git show HEAD^:full/path/to/file/from/top/dir/of/the/repository
- https://stackoverflow.com/questions/1395445/viewing-a-deleted-file-in-git - I got the answer from here. It also contains a few other alternate solutions.
git grep commands
dokuwiki table syntax
git grep -i --all-match -e '\^.*\^' -e '|.*|'
git commands usage
git cherry-pick <Commit1> <Commit2> <...>
- https://learngitbranching.js.org/ → Moving Work Around → 1: Cherry-pick Intro
newly created repo
git config user.name "Kamaraju S. Kusumanchi" git config user.email "firstname.lastname@example.org"
for git $\geq$ 2.23.0
git -c advice.detachedHead=false pull --rebase --autostash -v origin
for git $\leq$ 2.20.1
git pull --rebase --autostash -v origin
used in | https://github.com/KamarajuKusumanchi/rutils/blob/master/bin/git-up
git_notes.txt · Last modified: 2023/03/01 22:26 by raju