020.10 a
Description: Basic commands used in Git.
#000#IT_Knowledge#020#Operation_Knowledge#020.10#Git#020.10 a#git_init
git clone <GitHub Link or Git Links>
git add <file>
git commit -m "commit message"
git push
Merge
git checkout A
git merge B
Branch A : Start Branch that receive change
Branch B : The branch that has the changes you want to bring in.
After execution
After that A becomes A+ that update feature by B
When you tried after using existing project to git
git fetch origin
git merge origin/main --allow-unrelated-histories
Rebase
git checkout A
git rebase B
Branch A : The branch that you want to rewrite (usually a feature branch). This commit history will disapper/
Branch B : The branch you want your changes to be based on (often main
or develop
).
After execution
The branch A history will be disappered and, From last commit of branch B, Add Branch A's new commits.