Our company's workflow is to clone master branch into a _Test branch as we work on new features and we continually push/share this _Test branch until a set of features are complete and approved by client, then we merge to master branch and build and publish our sites. Then rinse and repeat.
The problem I'm having is git status isn't showing the correct ahead/behind (or more likely, I may not understand what it is supposed to show) while working on the _Test branch. If I do the following steps:
After step four, the git output is
[_Test d6fa824] Test commit
1 file changed, 1 insertion(+), 1 deletion(-)
Then after step five, the git output is
# On branch _Test
nothing to commit, working directory clean
Shouldn't it say?
Your branch is ahead of 'origin/_Test' by 1 commit.
If I look at qgit or gitk they show origin/_Test and remotes/origin/_Test respectively (correctly) 1 commit behind the last test commit. I'm running msysgit and git version outputs:
git version 1.8.1.mysysgit.1
So I'm confused why the output from git commit doesn't state that I'm ahead of origin/_Test (when obviously I am since I just committed) and why git status doesn't state same information.
Let me know if I need to provide any more info.
On branch master, Your branch is up to date with 'origin/master. As long as you haven't made any new commits that message is correct, unversioned/changed files that haven't been committed yet should be listed below it. If unversioned files don't show up, check if they might be hidden by a .
We can view the unpushed git commits using the git command. It will display all the commits that are made locally but not pushed to the remote git repository.
The git log command is Git's basic tool for exploring a repository's history. It's what you use when you need to find a specific version of a project or figure out what changes will be introduced by merging in a feature branch.
Use the git status command, to check the current state of the repository.
I resolved this problem.
You basically need to set up git tracking using
git branch --set-upstream *branch_name*
Read my full explanation here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With