Showing entries with tag "Git".

Found 4 entries

Git: Find the branch that a given commit landed on
If you need to find the branch that a commit was checked in to use the following command: ``` git branch --contains 26495cfd4ab17d4d685d0d352ed333f73d6d1b96 ``` This should show a list of branches, with the respective branched highlighted and preceed with an asterisk.
Git: Finding all commits that match a given line
If you need to show all the commits that modify a specific line you can use `git log` and the `-G` flag like this: ``` git log -G "version" docs/release_history.txt ``` This will show every commit that contains "version" in one of the modified lines anywhere the file `/docs/release_history.txt`
Git: Show changes made today or yesterday
I found two cool Git aliases that will show you all the commits that have been made today or yesterday. It's a simple way to figure out what you accomplished. Define the aliases: ``` git config --global "log --since=midnight --oneline --graph --decorate" git config --global alias.yesterday "log --after=yesterday.midnight --before 0am --oneline --graph --decorate" ``` Then run it with: ``` git today git...
Git: Create a new local branch and set up remote tracking
If you want to create a new branch in Git, and set it up so it's tracked upstream also do this: ``` git checkout -b branch_name git push -u origin branch_name ``` `git push -u` handles setting the upstream, as well as setting the local branch to track the remote branch.