1. When sync with remote repository,
your local branch "refs" may sometimes gets a message
"Your branch is behind ‘remote/xxx’ by 12 commits, and can be fast-forwarded."
This message means a remote branch xxx was newer than our own local xxx. This may be due to other's commit or our developing on other folder.
At this time, you can issue :
git checkout xxx
git merge remote/remote_repository/xxx
It will merge the remote commits to our local xxx branch.
2. When push back "branches", "commits" or "tags", it needs to issue;
git push remote_repository local_branch
3. Usually we have a development procedure like this
----------------------------------------------- Remote repository tree
|
| merge/fetch/push
----------------------------------------------- Local tree with local commits and branches.
We develop on local tree, commit then sync with remote repository.
The standard procedure for merge onto remote tree would be
a. issue fetch from remote tree
ie. git fetch git_remote_repository .
b. issue merge from remote tree with local branch
ie. assume we are developing on local branch "Do_Bob_Job" .
git merge git_remote_repository/Do_Bob_Job .
c. if there are conflicts and we fix it, then commit the fixings
ie. git commit -a -m"Add_for_Bob_Job" .
d. doing merge again
e. push on remote repository
ie. git push git_remote_repository.
This procedure should do regularly to reduce conflicts.
4. Generate GIT patch for specified index
git format-patch index^..index -o output_patch_file_path
Description :
index^ means previous of the specified index
5. Delete/Revert commits and move HEAD reference