-
Notifications
You must be signed in to change notification settings - Fork 2
Git express tutorial
2 branches:
-
Main
- this is the current dev branch, everyone work on it
-
Release
- this branch contain the revision used in production (on Grodoudou server)
- DO NOT DEVELOP ON THIS BRANCH!!!
- First, tag the master branch:
git checkout master git pull git tag vX.X.X git push --tag
- Then, merge it into release branch:
git checkout release git merge vX.X.X git push
git tag new_tag old_tag git push --tags
Now, there is a new tag on same commit as the old. Last step is to remove the old tag.
git push origin :refs/tags/old_tag git tag -d old_tag
git branch BRANCHNAME
git push origin BRANCHNAME
git branch -d BRANCHNAME
git push origin :BRANCHNAME
- In Ubuntu:
apt-get install git-core
After installing Git, please set your username and a email adress, with the following commands
git config --global user.name "YannoukForExample"
git config --global user.email [email protected]
Open a terminal and go where you want to store the revision on your hard disk, for example:
cd /var/www
Now download from github server, by replacing "yannouk" by YOUR username (your github password will be asked):
git clone https://[email protected]/Seizam/seizamcore
The git clone command automatically sets up your local master branch to track the remote master branch on the server you cloned from.
git pull
After editing/creating a file, you have to stage then by using the "add" command:
git add benchmarks.rb
You can follow the change you made since the last commit / pull
git status
will output something like
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: README
modified: benchmarks.rb
Changed but not updated:
(use "git add <file>..." to update what will be committed)
modified: benchmarks.rb
When you are ready to revision, run this command without forgetting to speak about your revision:
git commit -m "I made incredible things in this revision, the power of god is in mine."
Remember that any files you have created or modified, that you haven’t run "git add" on since you edited them, won’t go into this commit. They will stay as modified files on your disk. The following command will automatically "add" file already known in previous revision (=don't work for a newly created file) before commiting:
git commit -a -m 'added new benchmarks'
With the commit command, the changes are stored locally. You have to run this to push your work back up to the server:
git push origin master
/!\ use with caution
git reset --hard