vasanthk/git-tips-and-tricks sits at 66 stars on GitHub. Git Cheatsheet with Tips and Tricks
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Set your push.default to upstream to push branches to their upstreams (which is the same that pull will pull from), rather than pushing branches to ones matching in name (which is the default setting for push.default, matching).
git config push.default upstream
Squash PR commits into one
Fetch from upstream (when merging clone to main upstream branch) or origin (when merging branch to master)
git fetch upstream
git checkout mybranch
git merge upstream/master
If necessary, resolve conflicts and git commit...
git reset --soft upstream/master
git commit -am 'Some cool description for a single commit'
git push --force-with-lease
More on --force-with-lease option here. Note that it's super important that you merge before resetting, and that the argument is the same master branch. Otherwise you risk messing up your local history.
The --soft parameter tells Git to reset HEAD to another commit, but that’s it. If you specify --soft Git will stop there and nothing else will change. What this means is that the index and working copy don’t get touched, so all of the files that changed between the original HEAD and the commit you reset to appear to be staged.
Extra: To squash last few commits (eg. last 2 commits) use git reset --soft HEAD~2
Bumping version and publishing upstream's branch (when you already have a fork)
You will need to create local branches tracking remote branches.
Assuming that you've got only one remote called origin, this snippet will create local branches for all remote tracking ones:
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done
After that, git fetch --all will update all local copies of remote branches.
Also, git pull --all will update your local tracking branches, but depending on your local commits and how the 'merge' configure option is set it might create a merge commit, fast-forward or fail.
Keep & Manage different project sources in the current repository externally using git submodule
You are in the your project directory which need use external sources!
Add / map external sources:
git submodule add <project_repo>
Pull updated code from submodule repository
git submodule update --remote
Reset submodule code to initial state
git pull --update --resource-submodules
To clone project with submodule sources
git clone --recurse <main_project_repo>
In case you've cloned project without --recurse flag you will not have submodule data in your repository.
To load required data you need try next instruction:
Does vasanthk/git-tips-and-tricks have a project website?
No homepage URL was recorded for vasanthk/git-tips-and-tricks in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does vasanthk/git-tips-and-tricks have any tags?
TopGit's last sync did not record any GitHub topics for vasanthk/git-tips-and-tricks. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on vasanthk/git-tips-and-tricks?
The most recent commit recorded on vasanthk/git-tips-and-tricks was 4.6 years ago, based on the GitHub push timestamp. The repository has 20 forks — one of the better signals of community interest.
How many stars does vasanthk/git-tips-and-tricks have?
vasanthk/git-tips-and-tricks has 66 GitHub stars — refresh the page for the live number, or check github.com/vasanthk/git-tips-and-tricks. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is vasanthk/git-tips-and-tricks open source?
TopGit's metadata for vasanthk/git-tips-and-tricks does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
Where do I read more about vasanthk/git-tips-and-tricks?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/vasanthk/git-tips-and-tricks is the definitive source.
Read full README in the tab above.
Is git-tips-and-tricks worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of git-tips-and-tricks.