Download the repository using the git clonecommand
Update the downloaded repository using the git pull command
update your copy of repository with the version on remote server
`
Add a file, commit and pull with git add, git commit and git pull
Don’t forget to pull to download the latest changes before pushing
To add a file (a change) to your local index with git add
To actually commit these changes with git commit
To send those changes to your remote repository with git pull
Example
Remove a file using git rm
Branching
Branches are used to develop new features or modify codes isolated from each other. The master branch is the “default” branch when a repository is created. Use other branches for development and merge them back to the master branch.
View all branches that were ever checked out on your local copy using ` git branch `
indicates the branch used actually
View all distant branches using ` git branch `
Create your own branch on your local copy then transfer it on remote server
Create the branch
Move into this branch
Commit the changes
Push this local branch on the remote server
Get a distant branch on the local repository if the branch don’t exist locally
Method 1
Method 2
To merge another branch (ex: samtoolsBlock) into your active branch (e.g. master)
Move into the “active” branch (e.g. master)
Update your local repository to the newest commit,
Merging
`
Check and resolve the conflicts generated
You are responsible to merge those conflicts manually by editing the files shown by git status.
Commit and push the changes and the merge on the distant server
Remove a branche
on the remote server
`
on our local copy
`
Back to the change just before the last commit without losing the work done
+DIVERSES COMMANDES+
To get status
To get log
Pour mettre la commande du dessus en alias dans git (exemple avec git lg)
` git config –global alias.lg “log –color –graph –pretty=format:’%C(red)%h%Creset -%C(yellow)%d%Creset %s %C(green)(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit” `
pour virer un fichier du git quand il est trop gros (et qu’on ne peut plus pusher)