GIT: getting clean after a commit
This information is for Scilab developers and code contributors. See GIT for a table of content. If you are a user of Scilab, you probably don't need to look at this.
In this page, we describe the process to apply to get clean after a commit. The process that we suggest allows to avoid to mix the different commits.
Summary of the process
We assume that we work on the master.
The abstract is the following.
git fetch git reset --hard origin/master
Detailed session
Here is the detailed log.
myname@MYMACHINE /f/mygitrepository/scilab/scilab (master) $ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean) myname@MYMACHINE /f/mygitrepository/scilab/scilab (master) $ git fetch myname@MYMACHINE /f/mygitrepository/scilab/scilab (master) $ git reset --hard origin/master HEAD is now at eb2b520 bug 7988 bug with F2C version myname@MYMACHINE /f/mygitrepository/scilab/scilab (master) $ git status # On branch master nothing to commit (working directory clean)
Notes
When we work on a branch, the git reset command must be updated. For example, on the branch 5.3, the git reset command is the following.
git reset --hard origin/5.3