Skip to content

Latest commit

 

History

History
101 lines (81 loc) · 1.79 KB

git_help.md

File metadata and controls

101 lines (81 loc) · 1.79 KB

HELP GITHUB MELD_CLASSIFIER_GDL

Clone folder

  1. Git clone
git clone https://github.com/mathrip/meld_classifier_GDL.git
  1. Go into folder
cd meld_classifier_GDL
  1. 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)
  1. check in which branch you are
git branch

It should say:

* main

Create and work on new branch

#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]

Work on an existing branch from a remote

#checkout on a remote branch (from origin for example)

git checkout --track origin/[branch_name]

#Commit, push, etc are the same than above

Other tricks

#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>