Tags:
view all tags
---++ Using git Repositories This is a very quick guide to using git repositories. It assumes that git is installed and running on your machine. For git information and download, see [[http://git-scm.com/][git homepage]] . Git is easy to install from source (recommended). For more detailed information, consult the git man pages, or read the tutorials and howtos on the site given above. Also, run ==git help -a== to see all available git commands. ---++ Known git errors: If you see the following error: <verbatim> Warning: No merge candidate found because value of config option "branch.dev.merge" does not match any remote branch fetched. </verbatim> in response to git commands, make sure you are running at least version 1.5.3.1. Prior to this version, git failed to add a remote tracking branch to the git config file, resulting in this error. ---+++ Quick git Usage ==git add .== adds all files in the directory to the git repository ==git commit== commits all changes to the git repository ==git log== shows the log of commits to the repository ==git diff== shows changes between commits, or if outstanding changes have not been committed, shows these changes ==git init== creates a git repository in the current directory ==git branch== list, create, or delete branches ==git status== shows the status of the working tree ==git checkout <branch>== switches to a different branch (no branch name defaults to master branch) ---++Checking out a remote branch, and merging it with a local branch <verbatim> $ git branch newstuff origin/newstuff $ git checkout newstuff </verbatim> Great this new stuff looks pretty interesting, let's merge it back to the local master branch: <verbatim> $ git checkout master $ git merge newstuff </verbatim> Let's push it back to the repo <verbatim> $ git push origin master </verbatim> But say we want to push to a different remote branch? First, checkout the remote branch as local, merge the two, push back: <verbatim> $ git branch dev origin/dev $ git checkout dev $ git merge newstuff $ git push origin dev </verbatim> -- Main.DuncanPenfoldBrown - 2009-07-23
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
More topic actions...
Topic revision: r3 - 2009-12-22
-
crlb
Home
Site map
Altair web
Belle2 web
HEPrc web
Main web
Sandbox web
TWiki web
HEPrc Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Edit
Attach
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback