Skip to main content
improve formatting
Source Link
Brian Campbell
  • 329.6k
  • 58
  • 364
  • 342

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.

AHere are a few things that are good to learn about and non-obvious.

Rearrange a series of commits:

git rebase -i <base-rev> # Rearrange and edit a series of commits
# Find which commit broke your unit tests (or any other command that could check for
# some particular build failure or bug)

Find which commit broke your unit tests, in this case, make check; you could use any other command that could check for some particular build failure or bug and exit with a non-zero status on failure:

git bisect start HEAD <known good revision>; git bisect run make check

Show useful information about a remote and its branches:

git remote show <remote> # Show useful information about a remote and its branches

And branching in Git is easier than anything:

git checkout -b branch-name master # create a new branch, starting it at master
git pull origin master # merge in changes from the master branch on origin server
git checkout master; git merge branch-name # merge changes you made on the branch
git branch -d branch-name # once you're done with the branch

If you want to share the branch with others while you're working on it, or push it to a server for backup:

git checkout branch-name # assuming it's already been created
git push origin branch-name # push the branch to the origin server

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.

A few things that are good to learn about and non-obvious:

git rebase -i <base-rev> # Rearrange and edit a series of commits
# Find which commit broke your unit tests (or any other command that could check for
# some particular build failure or bug)
git bisect start HEAD <known good revision>; git bisect run make check
git remote show <remote> # Show useful information about a remote and its branches

And branching in Git is easier than anything:

git checkout -b branch-name master # create a new branch, starting it at master
git pull origin master # merge in changes from the master branch on origin server
git checkout master; git merge branch-name # merge changes you made on the branch
git branch -d branch-name # once you're done with the branch

If you want to share the branch with others while you're working on it, or push it to a server for backup:

git checkout branch-name # assuming it's already been created
git push origin branch-name # push the branch to the origin server

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.

Here are a few things that are good to learn about and non-obvious.

Rearrange a series of commits:

git rebase -i <base-rev>

Find which commit broke your unit tests, in this case, make check; you could use any other command that could check for some particular build failure or bug and exit with a non-zero status on failure:

git bisect start HEAD <known good revision>; git bisect run make check

Show useful information about a remote and its branches:

git remote show <remote> 

And branching in Git is easier than anything:

git checkout -b branch-name master # create a new branch, starting it at master
git pull origin master # merge in changes from the master branch on origin server
git checkout master; git merge branch-name # merge changes you made on the branch
git branch -d branch-name # once you're done with the branch

If you want to share the branch with others while you're working on it, or push it to a server for backup:

git checkout branch-name # assuming it's already been created
git push origin branch-name # push the branch to the origin server
Add a few useful commands
Source Link
Brian Campbell
  • 329.6k
  • 58
  • 364
  • 342

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.

A few things that are good to learn about and non-obvious:

git rebase -i <base-rev> # Rearrange and edit a series of commits
# Find which commit broke your unit tests (or any other command that could check for
# some particular build failure or bug)
git bisect start HEAD <known good revision>; git bisect run make check
git remote show <remote> # Show useful information about a remote and its branches

And branching in Git is easier than anything:

git checkout -b branch-name master # create a new branch, starting it at master
git pull origin master # merge in changes from the master branch on origin server
git checkout master; git merge branch-name # merge changes you made on the branch
git branch -d branch-name # once you're done with the branch

If you want to share the branch with others while you're working on it, or push it to a server for backup:

git checkout branch-name # assuming it's already been created
git push origin branch-name # push the branch to the origin server

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.

A few things that are good to learn about and non-obvious:

git rebase -i <base-rev> # Rearrange and edit a series of commits
# Find which commit broke your unit tests (or any other command that could check for
# some particular build failure or bug)
git bisect start HEAD <known good revision>; git bisect run make check
git remote show <remote> # Show useful information about a remote and its branches

And branching in Git is easier than anything:

git checkout -b branch-name master # create a new branch, starting it at master
git pull origin master # merge in changes from the master branch on origin server
git checkout master; git merge branch-name # merge changes you made on the branch
git branch -d branch-name # once you're done with the branch

If you want to share the branch with others while you're working on it, or push it to a server for backup:

git checkout branch-name # assuming it's already been created
git push origin branch-name # push the branch to the origin server
Source Link
Brian Campbell
  • 329.6k
  • 58
  • 364
  • 342

git ready has lots of tips on using Git, from beginner to advanced. See also the Git Wiki for all kinds of documentation and tips on how to use Git.