If I fork someone else's private Github repo into my account, is it going to appear in my account as a public repo?
2022-08-10
Question Someone gave me access to one of their private repo on Github. What I want to do is to fork that project into my own account, so I could make use of Github's pull request feature. I only have a basic account on Github, so I cannot make private repos on my own, but if I fork someone else's private repo into my account, is it going to appear in my account as public?…
How to remove a Gitlab project?
2022-08-09
Question I have created several repositories in GitLab. One of those was for testing purposes and has some commits and branches. I want to delete or remove this repository. How can I do this? Answer Go to the project page Select "Settings" Select the "General" section (you must be in the repository you want to delete it) If you have enough rights, then at the bottom of the page will be a button for "…
How to git ignore subfolders / subdirectories?
2022-08-08
Question I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein. .gitignore with "bin/" ignores "Debug" and "Release" folders, but also any dll's contained in the "bin" folder. bin/Debug or bin/Release in the .gitignore file does not exclude the directories unless I fully qualify the ignore pattern as Solution/Project/bin/Debug - which I don't want to do as I will need to include this full pattern for each project in my solution, as well as add it for any new projects added.…
Can Git hook scripts be managed along with the repository?
2022-08-07
Question We'd like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages. Git has hook scripts for that that are normally stored under <project>/.git/hooks/. However, those scripts are not propagated when people do a clone and they are not version controlled. Is there a good way to help everyone get the right hook scripts? Can I just make those hook scripts point to version controlled scripts in my repo?…
Git error on commit after merge - fatal: cannot do a partial commit during a merge
2022-08-07
Question I ran a git pull that ended in a conflict. I resolved the conflict and everything is fine now (I used mergetool also). When I commit the resolved file with git commit file.php -m "message" I get the error: fatal: cannot do a partial commit during a merge. I had the same issue before and using -a in commit worked perfectly. I think it's not the perfect way because I don't want to commit all changes.…
How do I run git log to see changes only for a specific branch?
2022-08-07
Question I have a local branch tracking the remote/master branch. After running git-pull and git-log, the log will show all commits in the remote tracking branch as well as the current branch. However, because there were so many changes made to the remote branch, I need to see just the commits made to the current local branch. What would be the Git command to use to only show commits for a specific branch?…
How do I 'overwrite', rather than 'merge', a branch on another branch in Git?
2022-08-06
Question I have two branches, email and staging. staging is the latest one and I no longer need the old changes in email branch, yet I don't want to delete them. So I just want to dump all the contents of staging into email so that they both point to the same commit. Is that possible? Answer You can use the 'ours' merge strategy: $ git checkout staging $ git merge -s ours email # Merge branches, but use our (=staging) branch head $ git checkout email $ git merge staging EDIT 2020-07-30:…