-
Notifications
You must be signed in to change notification settings - Fork 2
/
git_help.txt
77 lines (54 loc) · 2.34 KB
/
git_help.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
This is the help file for git.
git commit .
Does a commit for the files in this directory and below.
git commit -a
Does a 'git add' and commit for everything that has been changed
in the repository.
git status .
Shows the status of files in the current directory and below.
git push origin frederickproctor
Pushes a new branch 'frederickproctor' up to GitHub
# merge a single file:
git checkout A
git checkout --patch B f
# also consider 'git cherry-pick'
git diff --stat
Shows the files that would be changed, e.g.,
nist_core/include/nist_core/crcl_kuka_lwr.h | 6 ++--
nist_core/include/nist_core/crcl_robot.h | 8 +++--
nist_core/include/nist_core/crcl_robotiq.h | 10 +++---
nist_core/include/nist_core/crcl_schunk_sdh.h | 6 ++--
nist_core/include/nist_core/crcl_sim_robot.h | 2 +-
nist_core/include/nist_core/nist_core.h | 6 ++++
nist_core/include/nist_core/robotiq_gripper.h | 8 ++---
nist_core/include/nist_core/serial.h | 10 ++++--
nist_core/include/nist_core/socknet.h | 10 ++++--
nist_core/src/crcl_robot.cpp | 5 +++
nist_core/src/crcl_sim_robot.cpp | 44 ++++++++++++++-----------
nist_core/src/nist_core.cpp | 4 +++
12 files changed, 74 insertions(+), 45 deletions(-)
#
# Create a branch on the remote
#
First, you create your branch locally:
git checkout -b your_branch
The remote branch is automatically created when you push it to the
remote server. So when you feel ready for it, you can just do:
git push <remote-name> <branch-name>
Where <remote-name> is typically origin, the name which git gives to
the remote you cloned from. Your colleagues would then just pull that
branch, and it's automatically created locally.
Note however that formally, the format is:
git push <remote-name> <local-branch-name>:<remote-branch-name>
But when you omit one, it assumes both branch names are the
same. Having said this, as a word of caution, do not make the critical
mistake of specifying only :<remote-branch-name> (with the colon), or
the remote branch will be deleted!
So that a subsequent git pull will know what to do, you might instead
want to use:
git push -u <remote-name> <branch-name>
The -u option sets up an upstream branch.
#
# Delete a branch on the remote
#
git push origin --delete <branch name>