- Git clone
git clone https://github.com/mathrip/meld_classifier_GDL.git
- Go into folder
cd meld_classifier_GDL
- Check your remote
git remote -v
It should say :
origin https://github.com/mathrip/meld_classifier_GDL.git (fetch)
origin https://github.com/mathrip/meld_classifier_GDL.git (push)
- check in which branch you are
git branch
It should say:
* main
#Before creating a new branch, pull the changes from upstream. Your master needs to be up to date.
git pull
#Create the branch on your local machine and switch on this branch :
git checkout -b [name_of_your_new_branch]
#Push the branch on github :
git push origin [name_of_your_new_branch]
#commit a change on the branch
git commit -m 'description change'
#push change on origin/branch
git push origin [name_of_your_new_branch]
#checkout on a remote branch (from origin for example)
git checkout --track origin/[branch_name]
#Commit, push, etc are the same than above
#Switch from branch A to branch B: (Note: you need to have push your changes from branch A before to go on branch B)
git checkout [name_of_branch_B]
#To see local branches, run this command:
git branch
#To see remote branches, run this command:
git branch -r.
#To see all local and remote branches, run this command:
git branch -a.
#Delete a branch on your local filesystem :
git branch -d [name_of_your_new_branch]
#add commit from branch A to branch B
git checkout B
git cherry-pick <commit_NumberID>