Find and get rid of really big files from your git repo: https://rtyley.github.io/bfg-repo-cleaner/ Handy tool for getting rid of stale bug/feature branches that have already been merged in to the main release/master branches: https://github.com/arc90/git-sweep
Let’s say I have a feature branch called “feature-x” which I want to first rebase onto the “develop” branch. Then it is first best practice to squash all my feature-branch’s commits into a single commit and then merge it into the develop branch via a pull request. first checkout the […]
do the following to add new branch to stash: git clone profiles repo: git clone ssh://github.com/in/projectname.git git checkout new-base-profiles git branch temporary-branch-name # creates new branch git checkout temporary-branch-name # make changes to files. git add git commit git push origin temporary-branch-name then on stash -> create pull request source […]
A git project is made up of 3 parts: Working directory – This is the directory where all your project files and folders reside (along with the .git folder). Each of your files within this directory is in 1 of possible states, untracked, unmodified, modified, staged. Will cover more about […]
If there is file that is being tracked by git, but is a file you now want to delete. Then the best way to do it is by running the following git command: $ git remove filename.txt This command does 2 things, it first changes the file’s state to untrack, […]
If you want to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it like this git fetch origin git reset –hard origin/master http://git-scm.com/blog/2011/07/11/reset.html
To view a list of all branches do: git branch -a the one that has an asterix next to it is the one that is currently checked out.
There are some untracked files in your project file that you want git to completely ignore, e.g. temporary files, log files, etc. You can do this by creating a special new file called .gitignore which sits alongside the .git folder. this file can list everything you want ignored, here’s an […]