Tag: git branch

Git pushing a branch to remote not working

I created a local branch by using git checkout -b mybranch Then I made certain changes to it and pushed to remote with git push origin mybranch However, I cannot see my local changes in the remote mybranch. Therefore, I tried to push again: git push origin mybranch:mybranch Now I get message that everything is […]

git branch -d <branchname> throws error: branch <branchname> not found

When I type git branch i get * master localbranch but when I try to remove the branch, git branch -d localbranch i get a not found error: error: branch ‘localbranch’ not found., I also tried to force the delete with git branch -D localbranch but it’s giving me the same error. The branch was […]

How do I checkout the snapshot of the master branch from git at a given date/time?

If a commit was made in other branches and merged into master after the given date/time, the changes in that commit should not appear in the snapshot, even though the commit was made before the given date/time Option 2 in this answer doesn’t do the job I need, as it simply sorts the commits chronologically […]

How to add git repo to other repo under subfolder

I have git repo in folder final_app and I have to add new folder app_part which is already git project. When I copied and try git add . or git add –all but it doesn’t want to add app_part. How to add files from app_part folder to git repo final_app ?

Author for each remote or branch

Is there any way to set different authors for each remote or branch in Git? The only thing coming to my mind is scripting it using Git hooks (post-checkout/post-commit), which would check the current branch and change the author, but it would work only for branches, not remotes and doesn’t look elegant to me. Are […]

git submodule conflicted pushed

I have a really weird, bad scenario here. Disclaimer, I’m new to git, and I’ve kind of screwed up. SO I have lots of submodules in my fork, based on monodevelop. First: I couldn’t even update my submodules using git submodule update –init –recursive. I tried bunch of similar commands, with rebase, foreach, etc. So […]

Pushing changes to a specific remote branch in Git

I have remote branches such as: $ git branch -r origin/HEAD -> origin/development origin/deploy-prod origin/development origin/master I checkout origin/master as $ git checkout -b trq17 origin/master $ git branch development * trq17 Now I want to push changes in trq17 branch into remote origin/master. How can I do that?

How to pull remote Git master if it doesn't exist locally?

I created a Git “newfeature” branch on my laptop, implemented a new feature, and then merged newfeature into my master branch. As I was working on the new feature, I had also created and pulled this newfeature branch on my production server in order to test it there. Now that I’m done with this branch, […]

How to create an empty branch for documentation

We have several Linux servers in the office. I would like to keep some record of changes in settings. Therefore I thought it would be a good idea to put all configuration files in GIT. The setup I would like to have is as follows: bare repository –> configuration.git with a branch for every server […]

Checkout an older commit and create a new master branch?

As it seems, the master branch of one of my project’s went into a completely wrong direction. So what I want to do is: Checkout an older commit Develop things into a different direction using a new branch Call this new branch master and discontinue the old master branch How do I do this? I […]

Git Baby is a git and github fan, let's start git clone.