There is no tracking information for the current branch
2023-03-20
Question I've been using github from a relatively short period, and I've always used the client to perform commits and pulls. I decided to try it from the git bash yesterday, and I successfully created a new repo and committed files. Today I did changes to the repository from another computer, I've committed the changes and now I'm back home and performed a git pull to update my local version and I get this:…
In plain English, what does "git reset" do?
2023-03-18
Question I have seen interesting posts explaining subtleties about git reset. Unfortunately, the more I read about it, the more it appears that I don't understand it fully. I come from a SVN background and Git is a whole new paradigm. I got mercurial easily, but Git is much more technical. I think git reset is close to hg revert, but it seems there are differences. So what exactly does git reset do?…
Changing git commit message after push (given that no one pulled from remote)
2023-03-17
Question I have made a git commit and subsequent push. I would like to change the commit message. If I understand correctly, this is not advisable because someone might have pulled from the remote repository before I make such changes. What if I know that no one has pulled? Is there a way to do this? Answer Changing history If it is the most recent commit, you can simply do this:…
How to tell if a file is git tracked (by shell exit code)?
2023-03-17
Question Is there a way to tell if a file is being tracked by running some git command and checking its exit code? In other words: is git tracking a file? Answer try: git ls-files --error-unmatch <file name> will exit with 1 if file is not tracked
Error "Fatal: Not possible to fast-forward, aborting"
2023-03-16
Question Why is Git not allowing me to fast forward merge anymore? If I try to force it using --ff-only, I get the message fatal: Not possible to fast-forward, aborting. I realize that there are huge advantages to merge --no-ff, but I'm just puzzled why I can't --ff-only now? Answer Disclaimer: these commands will bring changes from the remote branch into yours. git pull --rebase. Unlike the other solution, you don't need to know the name of your destination branch.…
How do I remove local (untracked) files from the current Git working tree?
2023-03-15
Question How do I delete untracked local files from the current working tree? Answer git-clean - Remove untracked files from the working tree Synopsis git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>… Description Cleans the working tree by recursively removing files that are not under version control, starting from the current directory. Normally, only files unknown to Git are removed, but if the -x option is specified, ignored files are also removed.…
Managing large binary files with Git
2023-03-14
Question I am looking for opinions of how to handle large binary files on which my source code (web application) is dependent. We are currently discussing several alternatives: Copy the binary files by hand. Pro: Not sure. Contra: I am strongly against this, as it increases the likelihood of errors when setting up a new site/migrating the old one. Builds up another hurdle to take. Manage them all with Git. Pro: Removes the possibility to 'forget' to copy a important file Contra: Bloats the repository and decreases flexibility to manage the code-base and checkouts, clones, etc.…